package com.nexus.all.es.model;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.*;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * es笔记的实体
 */
@Data
@EqualsAndHashCode
@Document(indexName = "note")
@Setting
public class EsNote implements Serializable {
    @Id
    private Long id;

    @Field(analyzer = "ik_max_word",type = FieldType.Text)
    private String title;

    private Long userId;

    private String coverUrl;

    @Field(type = FieldType.Keyword)
    private String nickName;

    private String avatarUrl;

    @Field(type = FieldType.Nested, fielddata = true)
    private EsNoteContent esNoteContent;

    private Integer likeCount;

    private Integer commentCount;

    private Long createTime;
    private LocalDateTime createDateTime;
}
